<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="spring" uri="/WEB-INF/tlds/spring.tld"%>
<%@ taglib prefix="c" uri="/WEB-INF/tlds/c.tld"%>
<%@ taglib prefix="fn" uri="/WEB-INF/tlds/fn.tld"%>
<%@ taglib prefix="fmt" uri="/WEB-INF/tlds/fmt.tld"%>
<c:set var="BasePath" value="${pageContext.request.contextPath}"></c:set>
<c:set var="Plugins" value="${pageContext.request.contextPath}/res/plugins"></c:set>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>货品列表</title>
<link href="${Plugins}/ligerUI/skins/Aqua/css/ligerui-all.css" rel="stylesheet" type="text/css" />
<link href="${Plugins}/ligerUI/skins/ligerui-icons.css" rel="stylesheet" type="text/css" />
<script src="${Plugins}/jquery/jquery-1.4.4.min.js"	type="text/javascript"></script>
<script src="${BasePath}/res/js/common/utils.js" type="text/javascript"></script>
<script src="${Plugins}/ligerUI/js/ligerui.min.js" type="text/javascript"></script>
<script src="${BasePath}/res/js/common/jquery.form.js" type="text/javascript"></script>
<script src="${Plugins}/jquery-validation/jquery.validate.min.js" type="text/javascript"></script>
<script src="${Plugins}/jquery-validation/messages_cn.js" type="text/javascript"></script>
<script src="${BasePath}/res/js/common/jquery.validate.method.js" type="text/javascript"></script>
<script src="${Plugins}/datepicker/WdatePicker.js" type="text/javascript"></script>
<script type="text/javascript" src="${BasePath}/res/js/ligerCommon.js"></script>
<style type="text/css">
#searchbar{
	margin-bottom: 10px;
}
.navbar {
		height: 20px;
		border-bottom: #E6E6E6 solid 1px;
		line-height: 20px;
	}
.l-button-search{
	width: 50px;
	margin-left: 10px;
	padding-bottom: 2px;
	display: inline;
}
.l-button-test{width:80px; float:left; margin-left:10px; padding-bottom:2px;}
</style>
</head>
<body style="padding:6px; overflow:hidden;">
<div id="">
	<div class="navbar"><span>您当前的位置：基本信息管理 &gt;商品让利设置&gt;让利设置历史</span></div>
	<br/>
	<br/>
</div>
<div id="maingrid6" style="margin:0; padding:0"></div>
  <div style="display:none;">
  <!-- g data total ttt -->
</div>
<script type="text/javascript">
	var grid6 = null;
	var rows = ${rows};
	var total = ${total};
    var profitsData = {"Rows": rows, "Total": total};
    $(function () {
    	grid6 = $("#maingrid6").ligerGrid({
  	      columns: [
                    { display: '货品编码', name: 'prodNo', width: '12%', render: function(rowdata, rowindex, value) {
                    	return '<span title="' + value + '">' + value + '</span>';
                    } },
  	                { display: '商品名称', name: 'commoName', width: '12%', render: function(rowdata, rowindex, value){
  	                	return '<span title="' + value + '">' + value + '</span>';
  	                }},
  	                { display: '规格', width: '6%', name: 'casePakgSize' },
  	                { display: '品牌', name: 'brandName', width: '8%', render: function(rowdata, rowindex, value){
	                	return '<span title="' + value + '">' + value + '</span>';
	                }},
	                { display: '分类', name: 'catName', width: '12%', render: function(rowdata, rowindex, value){
	                	return rowdata.catName;
	                }},
	                { display: '原成本', name: 'originalCost', width: '10%', type: 'float', editor: { type: 'float'}, render: function(rowdata, rowindex, value){
	                	return value;
	                }},
	                { display: '原零售价', name: 'originalRetailCost', width: '10%', type: 'float', editor: { type: 'float'}, render: function(rowdata, rowindex, value){
	                	return value;
	                }},
	                { display: '原毛利(%)', name: 'originalRate', width: '10%', render: function(rowdata, rowindex, value){
	                	var value = '';
	                	if (typeof(rowdata.originalCost) != 'undefined' && !isNaN(rowdata.originalCost) && rowdata.originalCost > 0 && typeof(rowdata.originalRetailCost) != 'undefined' && !isNaN(rowdata.originalRetailCost) && rowdata.originalRetailCost > 0) {
	                		value = (((rowdata.originalRetailCost - rowdata.originalCost) / rowdata.originalRetailCost) * 100).toFixed(2);
	                	}
	                	return value;
	                }},
	                { display: '促销成本', name: 'promotionsCost', width: '10%', type: 'float', editor: { type: 'float'}, render: function(rowdata, rowindex, value){
	                	return value;
	                }},
	                { display: '促销零售价', name: 'promotionsRetailCost', width: '10%', type: 'float', editor: { type: 'float'}, render: function(rowdata, rowindex, value){
	                	return value;
	                }},
	                { display: '促销毛利(%)', name: 'promotionsRate', width: '10%', render: function(rowdata, rowindex, value){
	                	var value = '';
	                	if (typeof(rowdata.promotionsCost) != 'undefined' && !isNaN(rowdata.promotionsCost) && rowdata.promotionsCost > 0 && typeof(rowdata.promotionsRetailCost) != 'undefined' && !isNaN(rowdata.promotionsRetailCost) && rowdata.promotionsRetailCost > 0) {
	                		value = (((rowdata.promotionsRetailCost - rowdata.promotionsCost) / rowdata.promotionsRetailCost) * 100).toFixed(2);
	                	}
	                	return value;
	                }},
	                { display: '特价有效期', name: 'validTime', width: '25%', render: function(rowdata, rowindex, value) {
	                	var value = '';
	                		value += '<input type="hidden" id="tomorrow' + rowdata.__index + '" name="tomorrow" value="' + rowdata.tomorrow + '">';
	                		value += '<input id="validTimeStart' + rowdata.__index + '" type="text" name="validTimeStart" readonly="readonly" value="' + rowdata.validTimeStart + '" class="Wdate" value="" size="12" ';
                			value += 'disabled="disabled" onFocus="WdatePicker({dateFmt:\'yyyy-MM-dd\',readOnly:true,autoPickDate:true,maxDate:\'#F{$dp.$D(\\\'validTimeEnd' + rowdata.__index + '\\\')||\\\'2020-10-01\\\'}\'})" >~';
	                    	value += '<input id="validTimeEnd' + rowdata.__index + '" type="text" name="validTimeEnd" readonly="readonly" value="' + rowdata.validTimeEnd + '" class="Wdate" value="" size="12"';
	                    	value += 'disabled="disabled" onFocus="WdatePicker({dateFmt:\'yyyy-MM-dd\',readOnly:true,autoPickDate:true,minDate:\'#F{$dp.$D(\\\'validTimeStart' + rowdata.__index + '\\\')||\\\'2013-01-01\\\'}\'})" >';
                    	return value;
	                } }
 	            ], 
               	width: '100%',
 	            height: '100%',
  	            data: $.extend(true,{},profitsData)
  		});
    });
    
</script>


</body>
</html>